//-----------------------------参数
//url		                    :	请求页面数据的Url
//form   						:	form表单
//success						:	成功的回调函数
//progressHandlingFunction		:	进度条回调函数
//beforeSend					:	开始请求请触发的函数
//error							:   请求异常回调函数

//提交带文件的附件表单
function FileUpload(url,form,success,progressHandlingFunction,beforeSend,error){
	var formData = new FormData($(form)[0]);
    $.ajax({
        url: url,
        type: 'POST',
        xhr: function() {
            myXhr = $.ajaxSettings.xhr();
            if(myXhr.upload){
                myXhr.upload.addEventListener('progress',
                	function(e){
	                	if(e.lengthComputable){
	                    	progressHandlingFunction(e.loaded,e.total);
	                    }
	                },
	            false);
            }
            return myXhr;
        },
        dataType : "json",
        beforeSend: beforeSend,
        success: success,
        error: error,
        data: formData,
        cache: false,
        contentType: false,
        processData: false
    });
}